<template>
	<view class="arena-swiper-banner">
		<u-swiper :list="bannerData" :height="400"></u-swiper>
	</view>
	<view class="arena-title">
		<view class="arena-title-contents">
			<view class="title-contents">
				<text>{{getInfo?.name}}</text>
			</view>
			<view class="arena-start">
				<image src="@/static/club.png" mode=""></image>
				<text>{{getInfo?.star}}分</text>
			</view>
		</view>
	</view>
	<view class="arena-bottom-line">
		<areanDetails :getInfo="getInfo" />
	</view>
	<view class="arena-person-title">
		<view class="person-left-title">
			<text>助教人员</text>
		</view>
		<view class="person-right-text">
			<text>查看更多助教人员</text>
		</view>
	</view>
	<view class="arena-list">
		<view class="arena-person-list-swiper">
			<assistantCard />
		</view>
	</view>
	<view class="arena-person-title" style="margin-top: 0;">
		<view class="person-left-title">
			<text>用户评价</text>
			<text style="font-size: 26rpx;">（99+）</text>
		</view>
		<view class="person-right-text">
			<text>查看更多评价</text>
		</view>
	</view>
	<view class="evaluate-card">
		<evaluateCard />
	</view>

	<view class="arena-person-title">
		<view class="person-left-title">
			<text>俱乐部详情</text>
		</view>
	</view>
	<view class="angent-desc">
		<view class="angent-desc-image">
			<rich-text :nodes="getInfo?.content"></rich-text>
		</view>
	</view>
	<view class="fixed-content">
		<view class="fixed-button">
			<view class="button">
				<button @click="goToSlectAgentChange">前去选助教</button>
			</view>
		</view>
	</view>


</template>

<script lang="ts" setup>
	import { ref } from 'vue'
	import areanDetails from '@/compoments/arena-details.vue'
	import assistantCard from '@/compoments/assistant-card.vue'
	import evaluateCard from '@/compoments/evaluate-card.vue'
	import { postHttpsRequset } from '../../public-ts-file/request';
	const bannerData = ref(['https://images.unsplash.com/photo-1587174486073-ae5e5cff23aa?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8N3x8Z29sZnxlbnwwfHwwfHx8MA%3D%3D', 'https://images.unsplash.com/photo-1584837140804-599306fb37f9?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MTB8fGdvbGZ8ZW58MHx8MHx8fDA%3D'])
	import { onLoad } from '@dcloudio/uni-app'
	const goToSlectAgentChange = () => {
		uni.navigateTo({
			url: '/pages/index/angentList'
		})
	}


	onLoad((parms) => {
		console.log(parms)
		if (parms) {
			getDescription(parms.orderId)
		}
	})


	const getInfo = ref()
	const getDescription = (ids) => {
		const parms = {
			path: '/shop/info',
			methods: 'POST',
			data: {
				id: ids ? ids : 1
			}
		}
		postHttpsRequset(parms).then(async res => {
			if (res.code == 200) {
				getInfo.value = res.data
			}
		})
	}

	// 用户列表
	const userList = () => {
		const pamrs = {
			path: '/Comment/getlists',
			methods: 'POST',
			data: {
				shop_id: 1
			}
		}
		postHttpsRequset(pamrs).then(async res => {
			if (res.code == 200) {

			}
		})
	}
	userList()
</script>

<style lang="scss" scoped>
	.arena-swiper-banner {
		margin: 30rpx;
		margin-top: 20rpx;
		margin-bottom: 48rpx;
	}

	.arena-title {
		padding-bottom: 30rpx;
		border-bottom: 1px solid rgba(204, 204, 204, .2);

		.arena-title-contents {
			margin: 0 30rpx;

			.title-contents {
				text {
					font-size: 34rpx;
					font-weight: bold;
					font-family: 'SYTC';
				}
			}

			.arena-start {
				display: flex;
				align-items: center;
				margin-top: 4rpx;

				image {
					width: 40rpx;
					height: 40rpx;
				}

				text {
					margin-left: 10rpx;
					color: #FF5733;
					font-family: 'SHT';
					margin-top: 5rpx;
				}
			}
		}
	}

	.arena-bottom-line {
		border-bottom: 1px solid rgba(204, 204, 204, .2);
		padding: 30rpx;
		padding-top: 26rpx;
	}

	.arena-person-list-swiper {
		overflow: hidden;
		overflow-x: scroll;
	}


	.arena-person-title {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin: 0 30rpx;
		margin-top: 34rpx;
		margin-bottom: 24rpx;

		.person-left-title {
			text {
				font-size: 30rpx;
			}
		}

		.person-right-text {
			text {
				font-size: 26rpx;
				color: #999;
			}
		}
	}

	.evaluate-card {
		margin: 0 30rpx;
	}


	.angent-desc {
		margin: 0 30rpx;

		.angent-desc-image {
			border-radius: 10rpx;
			overflow: hidden;
			display: flex;
			flex-direction: column;

			image {
				width: 100%;
			}
		}
	}

	.fixed-content {
		position: fixed;
		bottom: 0;
		width: 100%;
		background: white;
		box-shadow: 0 0 4rpx rgba(51, 119, 254, .25);

		.fixed-button {
			margin: 0 30rpx;
			padding: 20rpx 0;

			.button {
				button {
					padding: 2rpx 0;
					background: #3377FE;
					color: white;
					font-size: 28rpx;
					border-radius: 1000rpx;

					&::after {
						display: none;
						outline: none;
						border: none;
					}
				}
			}
		}
	}
</style>